<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- qtwinmigrate-2.8-opensource/src/qwinwidget.cpp -->
<head>
  <title>QWinWidget Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="57" height="67" border="0" /></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td>
</tr></table><h1 class="title">QWinWidget Class Reference</h1>
<p>The QWinWidget class is a Qt widget that can be child of a native Win32 widget. <a href="#details">More...</a></p>
<pre> #include &lt;QWinWidget&gt;</pre><p>Inherits <a href="http://doc.trolltech.com/4.4/qwidget.html">QWidget</a>.</p>
<ul>
<li><a href="qwinwidget-members.html">List of all members, including inherited members</a></li>
<li><a href="qwinwidget-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qwinwidget.html#QWinWidget">QWinWidget</a></b> ( HWND <i>hParentWnd</i>, QObject * <i>parent</i> = 0, Qt::WFlags <i>f</i> = 0 )</li>
<li><div class="fn"/><b><a href="qwinwidget.html#dtor.QWinWidget">~QWinWidget</a></b> ()</li>
<li><div class="fn"/>void <b><a href="qwinwidget.html#center">center</a></b> ()</li>
<li><div class="fn"/>HWND <b><a href="qwinwidget.html#parentWindow">parentWindow</a></b> () const</li>
<li><div class="fn"/>void <b><a href="qwinwidget.html#show">show</a></b> ()</li>
</ul>
<ul>
<li><div class="fn"/>206 public functions inherited from <a href="http://doc.trolltech.com/4.4/qwidget.html#public-functions">QWidget</a></li>
<li><div class="fn"/>29 public functions inherited from <a href="http://doc.trolltech.com/4.4/qobject.html#public-functions">QObject</a></li>
<li><div class="fn"/>12 public functions inherited from <a href="http://doc.trolltech.com/4.4/qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"/>57 properties inherited from <a href="http://doc.trolltech.com/4.4/qwidget.html#properties">QWidget</a></li>
<li><div class="fn"/>1 property inherited from <a href="http://doc.trolltech.com/4.4/qobject.html#properties">QObject</a></li>
<li><div class="fn"/>19 public slots inherited from <a href="http://doc.trolltech.com/4.4/qwidget.html#public-slots">QWidget</a></li>
<li><div class="fn"/>1 public slot inherited from <a href="http://doc.trolltech.com/4.4/qobject.html#public-slots">QObject</a></li>
<li><div class="fn"/>1 signal inherited from <a href="http://doc.trolltech.com/4.4/qwidget.html#signals">QWidget</a></li>
<li><div class="fn"/>1 signal inherited from <a href="http://doc.trolltech.com/4.4/qobject.html#signals">QObject</a></li>
<li><div class="fn"/>1 public type inherited from <a href="http://doc.trolltech.com/4.4/qobject.html#public-variables">QObject</a></li>
<li><div class="fn"/>4 static public members inherited from <a href="http://doc.trolltech.com/4.4/qwidget.html#static-public-members">QWidget</a></li>
<li><div class="fn"/>4 static public members inherited from <a href="http://doc.trolltech.com/4.4/qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"/>38 protected functions inherited from <a href="http://doc.trolltech.com/4.4/qwidget.html#protected-functions">QWidget</a></li>
<li><div class="fn"/>7 protected functions inherited from <a href="http://doc.trolltech.com/4.4/qobject.html#protected-functions">QObject</a></li>
<li><div class="fn"/>1 protected function inherited from <a href="http://doc.trolltech.com/4.4/qpaintdevice.html#protected-functions">QPaintDevice</a></li>
<li><div class="fn"/>1 protected slot inherited from <a href="http://doc.trolltech.com/4.4/qwidget.html#protected-slots">QWidget</a></li>
<li><div class="fn"/>2 protected variables inherited from <a href="http://doc.trolltech.com/4.4/qobject.html#protected-variables">QObject</a></li>
<li><div class="fn"/>1 protected type inherited from <a href="http://doc.trolltech.com/4.4/qpaintdevice.html#protected-variables">QPaintDevice</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QWinWidget class is a Qt widget that can be child of a native Win32 widget.</p>
<p>The QWinWidget class is the bridge between an existing application user interface developed using native Win32 APIs or toolkits like MFC, and Qt based GUI elements.</p>
<p>Using QWinWidget as the parent of QDialogs will ensure that modality, placement and stacking works properly throughout the entire application. If the child widget is a top level window that uses the <tt>WDestructiveClose</tt> flag, QWinWidget will destroy itself when the child window closes down.</p>
<p>Applications moving to Qt can use QWinWidget to add new functionality, and gradually replace the existing interface.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QWinWidget"></a>QWinWidget::QWinWidget ( HWND <i>hParentWnd</i>, <a href="http://doc.trolltech.com/4.4/qobject.html">QObject</a> * <i>parent</i> = 0, <a href="http://doc.trolltech.com/4.4/qt.html#WFlags-typedef">Qt::WFlags</a> <i>f</i> = 0 )</h3>
<p>Creates an instance of <a href="qwinwidget.html">QWinWidget</a>. <i>hParentWnd</i> is the handle to the native Win32 parent. If a <i>parent</i> is provided the object is owned by that <a href="http://doc.trolltech.com/4.4/qobject.html">QObject</a>. <i>f</i> is passed on to the <a href="http://doc.trolltech.com/4.4/qwidget.html">QWidget</a> constructor.</p>
<h3 class="fn"><a name="dtor.QWinWidget"></a>QWinWidget::~QWinWidget ()</h3>
<p>Destroys this object, freeing all allocated resources.</p>
<h3 class="fn"><a name="center"></a>void QWinWidget::center ()</h3>
<p>Centers this widget over the native parent window. Use this function to have Qt toplevel windows (i.e&#x2e; dialogs) positioned correctly over their native parent windows.</p>
<pre> QWinWidget qwin(hParent);
 qwin.center();

 QMessageBox::information(&amp;qwin, &quot;Caption&quot;, &quot;Information Text&quot;);</pre>
<p>This will center the message box over the client area of hParent.</p>
<h3 class="fn"><a name="parentWindow"></a>HWND QWinWidget::parentWindow () const</h3>
<p>Returns the handle of the native Win32 parent window.</p>
<h3 class="fn"><a name="show"></a>void QWinWidget::show ()</h3>
<p>Shows this widget. Overrides <a href="http://doc.trolltech.com/4.4/qwidget.html#show">QWidget::show</a>().</p>
<p>See also <a href="qwinwidget-obsolete.html#showCentered">showCentered</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%" align="left">Copyright &copy; 2009 Nokia</td>
<td width="40%" align="center"><a href="http://doc.trolltech.com/trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt Solutions</div></td>
</tr></table></div></address></body>
</html>
